package com.controller;

import com.controller.vo.ResultVO;
import com.service.ConcernService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: ConcernController
 * Description:
 *
 * @author L_Z_R
 * @version 1.0
 * @create 2025/05/22 20:12
 */
@RestController
public class ConcernController extends BaseController{
     @Autowired
     private ConcernService concernService;

     @PostMapping("/saveConcern")
     public ResultVO<String> saveConcern(Integer accountId, Integer concernId){
          //关注
          concernService.addConcern(accountId, concernId);
          return success();
     }

     @PostMapping("/deleteConcern")
      public ResultVO<String> deleteConcern(Integer accountId, Integer concernId){
          //取消关注
          concernService.deleteConcern(accountId, concernId);
          return success();
     }

     @PostMapping("/getConcernCountByAccountId")
      public ResultVO<Integer> getConcernCountByAccountId(Integer accountId){
          return success(concernService.getConcernCountByAccountId(accountId));
     }

     @PostMapping("/getConcernedCountByAccountId")
      public ResultVO<Integer> getConcernedCountByAccountId(Integer accountId){
          return success(concernService.getConcernedCountByAccountId(accountId));
     }
}
